package cn.hncu.booksManagementSystem.in.vo;

import java.io.Serializable;

import cn.hncu.booksManagementSystem.utils.DateUtil;

/**
 * CreateTime: 2018年4月19日 下午7:20:31	
 * @author 宋进宇  Email:447441478@qq.com
 * Description:
 *	进货值对象
 */
public class InMainModel implements Serializable {
	private static final long serialVersionUID = 1L;
	//注入userEbi 违反设计原则了，值对象不该调用别的模块的方法，除了工具类的方法
	//private static UserEbi userEbi = UserEbiFactory.getInstanceOfUserEbi();
	
	private String id; //进货单编号 --- 主键
	private long inDate; //进货时间
	private String inUserId; //进货人员编号 --- 外键
	private String inUserName; //进货人姓名---为外键补的有个属性,提高用户体验
	
	
	public InMainModel() {
	}
	
	public String getInUserName() {
		return inUserName;
	}

	public void setInUserName(String inUserName) {
		this.inUserName = inUserName;
	}

	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public long getInDate() {
		return inDate;
	}
	public void setInDate(long inDate) {
		this.inDate = inDate;
	}
	public String getInUserId() {
		return inUserId;
	}
	public void setInUserId(String inUserId) {
		this.inUserId = inUserId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		InMainModel other = (InMainModel) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return  "订单编号："+id + " ,日期：" + DateUtil.long2String(inDate) + " ,进货人编号："+inUserId+" , " + inUserName;
		//违反设计原则---userEbi.getUserById(inUserId).getName();
	}
	
	
}
